<?php
# ============================================================================
# 版权所有  Chilcoo.com，并保留所有权利。
# 网站地址: http://www.chilcoo.com/erphp
# ----------------------------------------------------------------------------
# 这不是一个自由软件！你不能通过任何方式破解本软件.
# 使用:不允许对程序代码以任何形式任何目的的再发布。
# ============================================================================
# $Author: Chilcoo Inc. *
# $Official website : www.chilcoo.com
# 
# 文件信息:
# File : /login.inc.php
# 分类列表页面

class login{
	// loginId,adminId,name
	public $loginId = null;
	public $adminId = null;
	public $name = null;
	public $level = null;
	public $levelno = null;
	public $levelname = null;
	public $checker = null;
	public $rootAdmin = null;
	function __construct(){
		# Session 验证
		if(isset($_SESSION[config::conf_session_admin])){
			$row = $_SESSION[config::conf_session_admin];
			$this->loginId = $row['loginId'];
			$this->adminId = $row['adminId'];
			$this->name = $row['name'];
			$this->level = $row['level'];
			$this->levelno = $row['levelno'];
			$this->levelname = $row['levelname'];
			$this->checker = $row['checker'];
			$this->rootAdmin = $row['rootAdmin'];
		#Cookie 验证
		}else if(isset($_COOKIE["login"])){
			header('Location:'.
				config::conf_web_root.
				config::conf_web_manager_root.
				'/login.php?call=cookie&uri='.urlencode($_SERVER['REQUEST_URI']));
		}
		# 超时
		else{
			header('Location:'.
				config::conf_web_root.
				config::conf_web_manager_root.
				'/login.php?call=timeout');
		}
	}
}
$_login = new login();
$config->smarty->assign('login_name', $_login->name);
$config->smarty->assign('login_loginId', $_login->loginId);
$config->smarty->assign('login_adminId', $_login->adminId);
$config->smarty->assign('login_checker', $_login->checker);

$config->smarty->assign('login_level', $_login->level);
$config->smarty->assign('login_levelno', $_login->levelno);
$config->smarty->assign('login_levelname', $_login->levelname);
$config->smarty->assign('login_rootAdmin', $_login->rootAdmin);



?>